<?$this->load->view('rs12/header');?>

<?foreach ($this->mdl_posts->get(array('url_title'=>$this->uri->segment(3))) as $post) {?>

	<div class="post">
	
		<div class="post_h"></div>
		
		<div class="postcontent">
			<span class="date"><?=date('F d, Y', $post->date);?> </span>
			<h2><?=$post->title;?></h2>
			<?=$post->excerpt;?>
			<?=$post->extended;?>
		</div>
		
		<div class="post_b">
			<span class="permalink">
				<?=$this->inktype->anchor('post/' . $post->url_title, 'Read Full Story');?></span> <span class="category"><?=$this->inktype->category_links($post, 'category');?></span> <span class="comment"><?=$this->inktype->anchor('post/' . $post->url_title, $post->num_comments . ' Comments');?>
			</span>
		</div>
	
	</div>

<?}?>

<div id="comments">
<div id="commentop"></div>

<div id="commentcontent">

	<?=$this->inktype->form_open('mdl_comments', 'user_comment', array('id'=>'comment_form'));?>
	
	<input type="hidden" name="post_id" value="<?=$post->post_id;?>">
	
	<?if ($this->inktype->is_logged_in()) {?>
	
		<input type="hidden" name="user_id" value="<?=$this->session->userdata('user_id');?>">
	
	<?} else {?>

	<p><label for="author">Your Name</label>
	<input class="text" name="display_name" value="<?=$this->validation->display_name;?>" size="22" type="text" /></p>
	
	<?}?>
	
	<p><label for="comment">Your Comment</label><br />
	<textarea name="comment" cols="60" rows="10"><?=$this->validation->comment;?></textarea></p>
	
	<p>	<input name="submit" alt="submit" value="Submit Comment" type="submit" id="comment_button" /></p>
	
	</form>
	
	<br />
	
	<ol>
	<?foreach ($this->mdl_comments->get(array('post_id'=>$post->post_id)) as $comment) {?>
	
	    <li>
	      <?=$comment->display_name;?> <em>on</em> <?=date('F d, Y', $comment->comment_date);?>
	      <p><?=nl2br($comment->comment);?></p>
	
	    </li>
	
	<?}?>
	</ol>
	
</div>

<div id="commentbtm">
</div>

</div>

</div>

<?$this->load->view('rs12/sidebar');?>

<?$this->load->view('rs12/footer');?>